<template>
  <v-app id="layout">
    <app-header></app-header>
    <v-content>
      <notification></notification>
      <v-container fluid fill-height>
        <v-layout justify-center align-center>
          <router-view></router-view>
        </v-layout>
      </v-container>
    </v-content>
    <app-footer></app-footer>
  </v-app>
</template>

<script>
import AppHeader from '@/components/AppHeader'
import Notification from '@/components/Notification'
import AppFooter from '@/components/AppFooter'
import jwtToken from '@/helpers/jwt'
import Cookie from 'js-cookie'

export default {
  name: 'App',
  components: {
    AppHeader,
    AppFooter,
    Notification
  },

  created () {
    if (jwtToken.getToken()) {
      this.$store.dispatch('setAuthUser')
    } else if (Cookie.get('auth_id')) {
      this.$store.dispatch('refreshToken')
    }
  }
}
</script>

<style>

</style>
